<?php
namespace app\models;

use Yii;

class Outstock
{
	public static function getOutstockidByDrawingno($drawingno)
	{
		$query = new \yii\db\Query();

		$outstockList = $query->select("outstockid")
				  ->from("JXC_OUTSTOCKITEM")
				  ->where("drawingno like '%".$drawingno."%'")
				  ->all();

		$result = array();

		foreach($outstockList as $outstock){
			$result[] = $outstock["outstockid"];
		}

		return implode(",",$result);
	}
}